package com.nwpu.coursesupport.service.param;

import com.nwpu.coursesupport.entity.Task;
import com.nwpu.coursesupport.enumeration.Status;
import com.nwpu.coursesupport.enumeration.TaskType;
import lombok.Data;

import java.util.List;

public class TaskServiceParam {

    public static class CreateLessonTaskParam {
        private int lessonId;
        private TaskType type;
        private String title;
        private int numsOfAnswerers;
        private String description;
        private Status isVisible;
        private Status isAnswerVisible;

        public int getLessonId() {
            return lessonId;
        }

        public void setLessonId(int lessonId) {
            this.lessonId = lessonId;
        }

        public TaskType getType() {
            return type;
        }

        public void setType(TaskType type) {
            this.type = type;
        }

        public String getTitle() {
            return title;
        }

        public void setTitle(String title) {
            this.title = title;
        }

        public int getNumsOfAnswerers() {
            return numsOfAnswerers;
        }

        public void setNumsOfAnswerers(int numsOfAnswerers) {
            this.numsOfAnswerers = numsOfAnswerers;
        }

        public String getDescription() {
            return description;
        }

        public void setDescription(String description) {
            this.description = description;
        }

        public Status getIsVisible() {
            return isVisible;
        }

        public void setIsVisible(Status isVisible) {
            this.isVisible = isVisible;
        }

        public Status getIsAnswerVisible() {
            return isAnswerVisible;
        }

        public void setIsAnswerVisible(Status isAnswerVisible) {
            this.isAnswerVisible = isAnswerVisible;
        }

    }

    @Data
    public static class CreateParam extends Task {
//        public CreateParam(Task task) {
//            super(task.getId(),task.getAnswerAttachment(),task.getAnswerAttachmentBytes(),task.getAttachment(),task.getAttachmentBytes(),task.getAverage(),task.getContent(),task.getCourseId(),task.getCreateDate(),task.getCreateId(),task.getCreateName(),task.getDescription(),task.get);
//        }

        private List<ScoreItem> scoreItems;
        private List<CourseTarget> courseTargets;

        @Data
        public static class ScoreItem {
            private String scoreItem;
            private Float weight;//该项满分！
        }
        @Data
        public static class CourseTarget {
            private Integer courseTargetId;
            private Float weight;

        }
        @Override
        public String toString() {
            return super.toString()+
                    ", scoreItems=" + scoreItems +
                    ", courseTargets=" + courseTargets
                    ;
        }
    }

    public static class UpdateParam extends Task {

    }

    public static class AddAttachment {

        private int id;
        private String name;
        private String key;
        private int type;

        public int getId() {
            return id;
        }

        public void setId(int id) {
            this.id = id;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getKey() {
            return key;
        }

        public void setKey(String key) {
            this.key = key;
        }

        public int getType() {
            return type;
        }

        public void setType(int type) {
            this.type = type;
        }

    }

    public static class DeleteAttachment {
        private int id;
        private int type;
        private String key;

        public int getId() {
            return id;
        }

        public void setId(int id) {
            this.id = id;
        }

        public int getType() {
            return type;
        }

        public void setType(int type) {
            this.type = type;
        }

        public String getKey() {
            return key;
        }

        public void setKey(String key) {
            this.key = key;
        }
    }
}
